
function uppass() {
    if($("#newPassword1").val()!=$("#newPassword2").val()){
        alert("两次密码不一致")
        return;
    }

    var data = "password=" + $("#oldPassword").val()+ "&newPassword=" + $("#newPassword1").val();
    $.ajax({
        type: "POST",
        url: "sys/user/password",
        data: data,
        dataType: "json",
        success: function (result) {
            if (result.code == 0) {
                layer.close(index);
                layer.alert('修改成功', function (index) {
                    location.reload();
                });
            } else {
                layer.alert(result.msg);
            }
        }
    });
}